package com.vladimirjosu.backgammon;

import android.content.Context;
import android.view.MotionEvent;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.View.OnTouchListener;
import android.widget.ImageView;

public class Piece extends ImageView implements OnClickListener, OnTouchListener{
	public static final int HEIGHT = 20;
	public static final int WEIGHT = 20;
	private Type mType; 
	
	public static enum Type{
		UNDEFINED, WHITE, BLACK
	}
	@Override
	public void setEnabled(boolean enabled) {
		super.setEnabled(enabled);
	}

	public Piece(Context context, Type type) {
		super(context);
		mType = type;
		switch (mType) {
		case WHITE:
			setBackgroundResource(R.drawable.piece_white);
			break;
		case BLACK:
			setBackgroundResource(R.drawable.piece_black);
			break;
		default:
			break;
		}
		setScaleType(ScaleType.MATRIX);
		setAdjustViewBounds(false);
	}
	public Type getType(){
		return mType;
	}

	@Override
	public void onClick(View v) {
		
	}
	@Override
	public boolean onTouch(View v, MotionEvent event) {
		// TODO Auto-generated method stub
		return false;
	}
}
